
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG &mdash; CMake 3.27.4 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />
    
    <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/sphinx_highlight.js"></script>
    
    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP" href="CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.html" />
    <link rel="prev" title="CMAKE_&lt;LANG&gt;_LINK_EXECUTABLE" href="CMAKE_LANG_LINK_EXECUTABLE.html" />
 

  </head><body>

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.html" title="CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="CMAKE_LANG_LINK_EXECUTABLE.html" title="CMAKE_&lt;LANG&gt;_LINK_EXECUTABLE"
             accesskey="P">previous</a> |</li>
  <li>
    <img src="../_static/cmake-logo-16.png" alt=""
         style="vertical-align: middle; margin-top: -2px" />
  </li>
  <li>
    <a href="https://cmake.org/">CMake</a> &#187;
  </li>
  <li>
    <a href="../index.html">3.27.4 Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-variables.7.html" accesskey="U">cmake-variables(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="cmake-lang-linker-wrapper-flag">
<span id="variable:CMAKE_<LANG>_LINKER_WRAPPER_FLAG"></span><h1>CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG<a class="headerlink" href="#cmake-lang-linker-wrapper-flag" title="Permalink to this heading">¶</a></h1>
<div class="versionadded">
<p><span class="versionmodified added">New in version 3.13.</span></p>
</div>
<p>Defines the syntax of compiler driver option to pass options to the linker
tool. It will be used to translate the <code class="docutils literal notranslate"><span class="pre">LINKER:</span></code> prefix in the link options
(see <span class="target" id="index-0-command:add_link_options"></span><a class="reference internal" href="../command/add_link_options.html#command:add_link_options" title="add_link_options"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">add_link_options()</span></code></a> and <span class="target" id="index-0-command:target_link_options"></span><a class="reference internal" href="../command/target_link_options.html#command:target_link_options" title="target_link_options"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">target_link_options()</span></code></a>).</p>
<p>This variable holds a <a class="reference internal" href="../manual/cmake-language.7.html#cmake-language-lists"><span class="std std-ref">semicolon-separated list</span></a> of tokens.
If a space (i.e. &quot; &quot;) is specified as last token, flag and <code class="docutils literal notranslate"><span class="pre">LINKER:</span></code>
arguments will be specified as separate arguments to the compiler driver.
The <span class="target" id="index-0-variable:CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP"></span><a class="reference internal" href="CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.html#variable:CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP" title="CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP</span></code></a> variable can be specified
to manage concatenation of arguments.</p>
<p>For example, for <code class="docutils literal notranslate"><span class="pre">Clang</span></code> we have:</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">set</span> <span class="nf">(</span><span class="no">CMAKE_C_LINKER_WRAPPER_FLAG</span><span class="w"> </span><span class="s">&quot;-Xlinker&quot;</span><span class="w"> </span><span class="s">&quot; &quot;</span><span class="nf">)</span>
</pre></div>
</div>
<p>Specifying <code class="docutils literal notranslate"><span class="pre">&quot;LINKER:-z,defs&quot;</span></code> will be transformed in
<code class="docutils literal notranslate"><span class="pre">-Xlinker</span> <span class="pre">-z</span> <span class="pre">-Xlinker</span> <span class="pre">defs</span></code>.</p>
<p>For <code class="docutils literal notranslate"><span class="pre">GNU</span> <span class="pre">GCC</span></code>:</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">set</span> <span class="nf">(</span><span class="no">CMAKE_C_LINKER_WRAPPER_FLAG</span><span class="w"> </span><span class="s">&quot;-Wl,&quot;</span><span class="nf">)</span>
<span class="nf">set</span> <span class="nf">(</span><span class="no">CMAKE_C_LINKER_WRAPPER_FLAG_SEP</span><span class="w"> </span><span class="s">&quot;,&quot;</span><span class="nf">)</span>
</pre></div>
</div>
<p>Specifying <code class="docutils literal notranslate"><span class="pre">&quot;LINKER:-z,defs&quot;</span></code> will be transformed in <code class="docutils literal notranslate"><span class="pre">-Wl,-z,defs</span></code>.</p>
<p>And for <code class="docutils literal notranslate"><span class="pre">SunPro</span></code>:</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">set</span> <span class="nf">(</span><span class="no">CMAKE_C_LINKER_WRAPPER_FLAG</span><span class="w"> </span><span class="s">&quot;-Qoption&quot;</span><span class="w"> </span><span class="s">&quot;ld&quot;</span><span class="w"> </span><span class="s">&quot; &quot;</span><span class="nf">)</span>
<span class="nf">set</span> <span class="nf">(</span><span class="no">CMAKE_C_LINKER_WRAPPER_FLAG_SEP</span><span class="w"> </span><span class="s">&quot;,&quot;</span><span class="nf">)</span>
</pre></div>
</div>
<p>Specifying <code class="docutils literal notranslate"><span class="pre">&quot;LINKER:-z,defs&quot;</span></code> will be transformed in <code class="docutils literal notranslate"><span class="pre">-Qoption</span> <span class="pre">ld</span> <span class="pre">-z,defs</span></code>.</p>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="CMAKE_LANG_LINK_EXECUTABLE.html"
                          title="previous chapter">CMAKE_&lt;LANG&gt;_LINK_EXECUTABLE</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.html"
                          title="next chapter">CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.html" title="CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG_SEP"
             >next</a> |</li>
        <li class="right" >
          <a href="CMAKE_LANG_LINK_EXECUTABLE.html" title="CMAKE_&lt;LANG&gt;_LINK_EXECUTABLE"
             >previous</a> |</li>
  <li>
    <img src="../_static/cmake-logo-16.png" alt=""
         style="vertical-align: middle; margin-top: -2px" />
  </li>
  <li>
    <a href="https://cmake.org/">CMake</a> &#187;
  </li>
  <li>
    <a href="../index.html">3.27.4 Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-variables.7.html" >cmake-variables(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">CMAKE_&lt;LANG&gt;_LINKER_WRAPPER_FLAG</a></li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
        &#169; Copyright 2000-2023 Kitware, Inc. and Contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
    </div>
  </body>
</html>